//
//  NewsTableViewCell.m
//  UI10_CellSelfSize(自适应)
//
//  Created by Hanlingyu on 16/7/27.
//  Copyright © 2016年 ltq. All rights reserved.
//

#import "NewsTableViewCell.h"
#import "UIView+Frame.h"

@interface NewsTableViewCell ()
@property (nonatomic, strong) UILabel *newsLabel;
@end

@implementation NewsTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _newsLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        _newsLabel.numberOfLines = 0;
        [self.contentView addSubview:_newsLabel];
    }
    return self;
}


- (void)layoutSubviews {
    [super layoutSubviews];
    NSLog(@"contentView---%lf", self.contentView.ltq_height);
    NSLog(@"self.view--- %lf", self.ltq_height);
    // 会给线预留0.5高度, 用self的高度
    _newsLabel.frame = CGRectMake(0, 0, self.contentView.ltq_width, self.ltq_height);
}

- (void)setString:(NSString *)string {    
    _string = [string copy];
    self.newsLabel.text = string;
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
